/**
*  用于巡线小车的电机控制和颜色传感器的获取
*
*/

#ifndef XYXKC_I2C_H
#define XYXKC_I2C_H

#if ARDUINO >= 100
#include <Arduino.h>
#else
#include <WProgram.h>
#endif
#include <Wire.h> 

#define I2C_STC8H8K64U_ADDR 45  

class XYXKC_I2C
{
    public:
        uint8_t date[16];   
        XYXKC_I2C();
        void init();
        void begin();
        void read(uint8_t *date);
        void write(uint8_t h);
        char* readString(uint8_t len);
    private:
        TwoWire *_wire;
        uint8_t _i2caddr;
        char _charData1[9];
        char _charData2[17];
};
 
#endif   